/**
 * 
 */
package persistence.test;

import java.util.List;

import persistence.annotation.Id;
import persistence.annotation.OneToMany;
import persistence.annotation.Transient;

/**
 * @author dga
 * 
 */
public class Category {
	private String title;
	private Long id;
	private List<Book> books;

	@Id
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Transient
	@OneToMany(mappedBy = "category")
	public List<Book> getBooks() {
		return books;
	}

	public void setBooks(List<Book> books) {
		this.books = books;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Category [books=" + books + ", id=" + id + ", title=" + title + "]";
	}

}
